<template>
    <div v-if="openState" class="nzfba-popup" :style="mosk ? 'background: rgba(0,0,0,.'+moskOpacity+');z-index:'+zIndex : 'z-index'+zIndex ">
        <div class="nzfba-popup-box" :style="'width: '+ width +'px;top:'+((this.vtp.winHei()-height)/2)+'px;left:'+((this.vtp.winWid()-width)/2)+'px;'">
            <div class="nzfba-pbox-title" v-if="titleShow">
                <a href="javascript:;" class="fl" @click="closeFun">取消</a>
                <span>{{ title }}</span>
                <a href="javascript:;" class="fr" @click.stop="submit">确认</a>
            </div>
            <div class="nzfba-pbox-content"  :style="'height: '+ titleShow ? (height-53) : height +'px;'">
                <slot></slot>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props : {
        openState : {
            type : Boolean,
            default : false
        },
        mosk : {
            type : Boolean,
            default : true
        },
        titleShow : {
            type : Boolean,
            default : true
        },
        moskOpacity:{
            type : Number,
            default : 5
        },
        width : {
            type : Number,
            default : 500
        },
        height : {
            type : Number,
            default : 300
        },
        title : {
            type : String,
            default : '这是弹窗'
        },
        zIndex : {
            type : Number,
            default : 1000
        }
    },
    data(){
        return {
        }
    },
    methods:{
        closeFun(){
            this.$emit('closeFun');
        },
        submit(){
            this.$emit('submit');
        }
    }
    
}
</script>

<style>

</style>